package com.xinqi.modules.sys.dict.manager;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xinqi.common.mybatis.data.service.BaseService;
import com.xinqi.modules.sys.dict.domain.DictVersionStageEntity;
import com.xinqi.modules.sys.dict.dto.req.DictVersionStageQueryDTO;
import com.xinqi.modules.sys.dict.dto.rsp.DictStageResultDTO;
import com.xinqi.modules.sys.dict.dto.rsp.DictVersionStageResultDTO;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 字典-版本学科管理层
 *
 * @author: linkai
 * @date: 2023/05/07
 */
public interface DictVersionStageManager extends BaseService<DictVersionStageEntity> {

    /**
     * 自定义分页查询
     */
    Page<DictVersionStageResultDTO> findPage(Page<Object> page, DictVersionStageQueryDTO query);

    /**
     * 自定义列表查询
     */
    List<DictVersionStageResultDTO> findList(DictVersionStageQueryDTO query);

    /**
     * 根据id查询 字典-版本学科数据
     */
    DictVersionStageEntity findById(Long id);

    /**
     * 根据id删除 字典-版本学科数据
     */
    @Transactional(rollbackFor = Exception.class)
    boolean deleteById(Long id);

    List<DictStageResultDTO> findStageByVersionId(Long versionId);

    @Transactional(rollbackFor = Exception.class)
    Boolean addStage(Long versionId, List<Long> stageIdList);

    @Transactional(rollbackFor = Exception.class)
    Boolean delStage(Long versionId);

}
